package cn.edu.ldu.protocol;

import cn.edu.ldu.controller.FriendController;
import cn.edu.ldu.entity.FriendsEntity;
import cn.edu.ldu.util.Consts;
import cn.edu.ldu.util.L;
import cn.edu.ldu.views.controller.MainUIController;
import cn.edu.ldu.views.main.MainUI;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;

import java.util.HashMap;
import java.util.List;

public class FriendOnline {

    public FriendOnline(Protocol protocol){
        FriendsEntity friends = JSONObject.parseObject(protocol.getData(),FriendsEntity.class);
        L.OK(friends,FriendOnline.class);

        //获取新的在线好友
        FriendController.addOnline(friends);

        MainUIController.getMainUI().updateFrinedList(friends.getUserAccountEntity().getNickName());

    }
}
